function isEmpty(value: any) {
  return Boolean(value === null || value === undefined || value === '');
}
export const nonEmpty = <T extends Record<string, unknown>>(object: T): T => {
  if (Object.prototype.toString.call(object) === '[object Object]') {
    const newObject: T = { ...object };
    Object.keys(newObject).forEach((key) => {
      if (isEmpty(newObject[key as keyof T])) {
        delete newObject[key as keyof T];
      }
    });
    return newObject;
  }
  return object;
};
